var status = 0;
var eff1 = "#fUI/UIPVP.img/MiniMapIcon/star#";
var ttt = "#fUI/UIPVP.img/MiniMapIcon/star#"; //"+ttt+"//美化1
var eff = "#fUI/UIWindow2.img/AttackRangking/1#"; //小皇冠
var ttt = "#fUI/UIPVP.img/MiniMapIcon/star#"; //小黄心
var 头顶 = "#fItem/Cash/0501.img/05010002/effect/default/7#";
var tz12 = "#fEffect/CharacterEff/1112924/0/0#"; //黄星
var tz13 = "#fEffect/CharacterEff/1112925/0/0#"; //蓝星
var tz14 = "#fEffect/CharacterEff/1112926/0/0#"; //红星
var 横条 = "#fEffect/SetEff.img/64/backgrnd/20"; //雪人
var us = "#fUI/CashShop.img/CSDiscount/bonus#"; //小黄心
var ums = "#fUI/UIWindowPL.img/GodOfBrain/npcAni3/stand/0#"; //小黄心
var F123 = "#fMob/2400204.img/move/4#"; //迷你女皇
var IconA = "#fEffect/CharacterEff/1112903/0/0#"; //红心
var IconB = "#fEffect/CharacterEff/1112904/0/0#"; //彩心
var IconC = "#fEffect/CharacterEff/1112924/0/0#"; //黄星
var IconD = "#fEffect/CharacterEff/1112925/0/0#"; //蓝星
var IconE = "#fEffect/CharacterEff/1112926/0/0#"; //红星
var IconF = "#fUI/RunnerGame.img/RunnerGameUI/UI/Point/2#"
var 账户 = "#fUI/StatusBar3.img/FadeYesNo/icon5#"; //"+ttt+"//美化1
var 赞助 = "#fUI/StatusBar3.img/FadeYesNo/icon6#"; //"+ttt+"//美化1
var 点卷 = "#fUI/CashShop.img/CashItem/0#"; //"+ttt+"//美化1
var 抵用 = "#fUI/CashShop.img/CashItem_label/0#"; //"+ttt+"//美化1
var 活跃 = "#fUI/CashShop.img/CashItem_label/2#"; //"+ttt+"//美化1
var 积分 = "#fUI/CashShop.img/CashItem_label/3#"; //"+ttt+"//美化1
var PK = "#fUI/CashShop.img/CashItem_label/1#"; //"+ttt+"//美化1
function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001 || cm.getMapId() == 910340000) {
        cm.sendOk("很遗憾，您因为在特殊地图无法使用此功能.")
        cm.dispose();
    } else if (status == 0) {
        var selStr = "\r\n#n#r#e您可以进行以下兑换操作：\r\n\r\n";
        selStr += "#L1#" + ums + " #b#e#v4310098#===============>#v4310097##r[兑换比例：10:1]\r\n\r\n";
        selStr += "#L2#" + ums + " #b#e#v4310143#===============>#v4310058##r[兑换比例：15:1]\r\n\r\n";
        selStr += "#L3#" + ums + " #b#e#v4310143#===============>#v4310156##r[兑换比例：15:1]\r\n\r\n";
        selStr += "#L4#" + ums + " #b#e#v4310143#===============>#v4310199##r[兑换比例：20:1]\r\n\r\n";
        selStr += "#L5#" + ums + " #b#e#v4310143#===============>#v4310218##r[兑换比例：20:1]\r\n\r\n";
        cm.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {
            case 1:
                cm.dispose();
                cm.openNpc(9400402, "贝勒德币"); // 贝勒德币
                break;
            case 2:
                cm.dispose();
                cm.openNpc(9400402, "麦格纳斯币"); // 麦格纳斯币埃苏莱布斯币
                break;
            case 3:
                cm.dispose();
                cm.openNpc(9400402, "埃苏莱布斯币"); // 埃苏莱布斯币
                break;
            case 4:
                cm.dispose();
                cm.openNpc(9400402, "烙印币"); // 烙印币
                break;
            case 5:
                cm.dispose();
                cm.openNpc(9400402, "幻影币"); // 幻影币
                break;


        }
    }
}